package com.ethink.system.facade.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.system.api.SystemRoleFacade;
import com.ethink.system.api.info.SystemRoleInfo;
import com.ethink.system.api.request.SystemRoleAddRequest;
import com.ethink.system.api.request.SystemRoleQueryRequest;
import com.ethink.system.api.request.SystemRoleUpdateRequest;
import com.ethink.system.api.response.SystemRoleAddResponse;
import com.ethink.system.api.response.SystemRoleDeleteResponse;
import com.ethink.system.api.response.SystemRoleDetailResponse;
import com.ethink.system.api.response.SystemRoleUpdateResponse;
import com.ethink.system.service.SystemRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 系统角色表 Facade接口实现
 *
 * @author default
 * @date 2022-09-27
 */
@RestController
@Slf4j
@RequestMapping(value = "system-service/facade/v1/systemRole")
public class SystemRoleFacadeImpl implements SystemRoleFacade {

    @Autowired
    private SystemRoleService systemRoleService;

    @Override
    public Page<SystemRoleInfo> querySystemRole(SystemRoleQueryRequest request) {
        return systemRoleService.querySystemRole(request);
    }

    @Override
    public SystemRoleDetailResponse getSystemRoleById(Long systemRoleId) {
        return systemRoleService.getSystemRoleById(systemRoleId);
    }

    @Override
    public List<SystemRoleInfo> listSystemRole(SystemRoleQueryRequest request) {
        return systemRoleService.listSystemRole(request);
    }

    @Override
    public SystemRoleAddResponse addSystemRole(SystemRoleAddRequest request) {
        return systemRoleService.addSystemRole(request);
    }

    @Override
    public SystemRoleUpdateResponse updateSystemRole(SystemRoleUpdateRequest request) {
        return systemRoleService.updateSystemRole(request);
    }

    @Override
    public SystemRoleDeleteResponse deleteSystemRole(Long systemRoleId) {
        return systemRoleService.deleteSystemRole(systemRoleId);
    }

}